using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PowerPlant : CheckPoint
{
    public WatcherTower _watcherTowerA1;

    private void OnCollisionStay(Collision collision)
    {
        Player player = collision.gameObject.GetComponent<Player>();
        if (player != null && player._isMessenger)
        {
            //open the gate, and the generator of the power plant is also actived
            _watcherTowerA1.AllLightsOn();//the building nearby get the power, and the lights open
                                      //and the message "The Messenger has reached the battle area 'PowerPlant'" was broadcast, all units will get there to protect or stop the Messenger.
        }
    }
}
